package cn.exrick.xboot.shop.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableField;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author yuhaifei
 * @since 2022-01-10
 */
@Data
@TableName("shop_comment")
@ApiModel(value = "评论表")
public class ShopComment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    @TableField(value = "id")
    @ApiModelProperty(value = "")
    private Integer id;

    /**
     *
     */
    @TableField(value = "avatar")
    @ApiModelProperty(value = "")
    private String avatar;

    /**
     *
     */
    @TableField(value = "nickname")
    @ApiModelProperty(value = "")
    private String nickname;

    /**
     * 点赞数
     */
    @TableField(value = "fabulous")
    @ApiModelProperty(value = "点赞数")
    private Integer fabulous;

    /**
     * 评论内容
     */
    @TableField(value = "content")
    @ApiModelProperty(value = "评论内容")
    private String content;

    /**
     * 发布时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "dtime")
    @ApiModelProperty(value = "发布时间")
    private Date dtime;

    /**
     * parent_id
     */
    @TableField(value = "parent_id")
    @ApiModelProperty(value = "parent_id")
    private String parentId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户id")
    private String userId;

    /**
     * 根id
     */
    @TableField(value = "source_id")
    @ApiModelProperty(value = "根id")
    private Integer sourceId;

    /**
     * 文章关联id
     */
    @TableField(value = "tid")
    @ApiModelProperty(value = "文章关联id")
    private Integer tid;

    @TableField(exist = false)
    private Integer replayNum;

    @TableField(exist = false)
    List<ShopComment> children;

}
